package com.ruoyi.merchant.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.merchant.mapper.ShopMapper;
import com.ruoyi.merchant.domain.Shop;
import com.ruoyi.merchant.service.IShopService;

/**
 * 店铺Service业务层处理
 * 
 * @author jktam
 * @date 2025-11-03
 */
@Service
public class ShopServiceImpl implements IShopService 
{
    @Autowired
    private ShopMapper merchantMapper;

    /**
     * 查询店铺
     * 
     * @param ShopId 店铺主键
     * @return 店铺
     */
    @Override
    public Shop selectShopById(Long merchantId)
    {
        return merchantMapper.selectShopById(merchantId);
    }

    /**
     * 查询店铺列表
     * 
     * @param merchant 店铺
     * @return 店铺
     */
    @Override
    public List<Shop> selectShopList(Shop merchant)
    {
        return merchantMapper.selectShopList(merchant);
    }

    /**
     * 新增店铺
     * 
     * @param merchant 店铺
     * @return 结果
     */
    @Override
    public int insertShop(Shop merchant)
    {
        merchant.setCreateTime(DateUtils.getNowDate());
        return merchantMapper.insertShop(merchant);
    }

    /**
     * 修改店铺
     * 
     * @param merchant 店铺
     * @return 结果
     */
    @Override
    public int updateShop(Shop merchant)
    {
        merchant.setUpdateTime(DateUtils.getNowDate());
        return merchantMapper.updateShop(merchant);
    }

    /**
     * 批量删除店铺
     * 
     * @param ids 需要删除的店铺主键
     * @return 结果
     */
    @Override
    public int deleteShopByIds(Long[] merchantIdIds)
    {
        return merchantMapper.deleteShopByIds(merchantIdIds);
    }

    /**
     * 删除店铺信息
     * 
     * @param id 店铺主键
     * @return 结果
     */
    @Override
    public int deleteShopById(Long merchantId)
    {
        return merchantMapper.deleteShopById(merchantId);
    }
}
